/**
 * Post.js
 * 
 * @description :: TODO: You might write a short summary of how this model works
 *              and what it represents here.
 * @docs :: http://sailsjs.org/#!documentation/models
 */

module.exports = {

	attributes : {
		
		content : {
			type : 'text',
			required : true
		},

		owner : {
			model : 'User',
			required : true
		},
		
		likes : {
			type : 'integer',
			defaultsTo : 0
		},
		
		comments : {
			collection : 'Comment',
			via : 'post'
		},
		
		attachments : {
			collection : 'WechatFile',
			via : 'post'
		}
	}
};
